package com.hinnotek.amoeba.repo

import com.hinnotek.amoeba.api.ApiService
import com.hinnotek.amoeba.base.BaseBean
import com.hinnotek.amoeba.bean.old.AmibaReimburseByIdBean
import com.hinnotek.amoeba.bean.old.AmibaReimbursePageByUserIdBean
import com.lee.common.base.BaseRepository
import com.lee.common.network.net.StateLiveData
import okhttp3.RequestBody
import javax.inject.Inject

class AmibaReimburseRepo  @Inject constructor(private val service: ApiService) : BaseRepository() {

    /**
     * app端获取合同列表分页接口
     */
    suspend fun updateAmibaReimburse(body: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.updateAmibaReimburse(body) }, stateLiveData)
    }
    
    /**
     * app端获取合同列表分页接口
     */
    suspend fun getAmibaReimbursePageByUserId(body: RequestBody, stateLiveData: StateLiveData<MutableList<AmibaReimbursePageByUserIdBean>>) {
        executeResp({ service.getAmibaReimbursePageByUserId(body) }, stateLiveData)
    }

    suspend fun getAmibaReimburseById(amibaReimburseId: Int, stateLiveData: StateLiveData<AmibaReimburseByIdBean>) {
        executeResp({ service.getAmibaReimburseById(amibaReimburseId) }, stateLiveData)
    }

    suspend fun backAmibaReimburse(amibaReimburseId: Int, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.backAmibaReimburse(amibaReimburseId) }, stateLiveData)
    }

    suspend fun resubmitAmibaReimburse(amibaReimburseId: Int, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.resubmitAmibaReimburse(amibaReimburseId) }, stateLiveData)
    }

    suspend fun addAmibaReimburse(requestBody: RequestBody, stateLiveData: StateLiveData<BaseBean>) {
        executeResp({ service.addAmibaReimburse(requestBody) }, stateLiveData)
    }
}